#include "Singleton.h"
#include <string>
#include <sstream>
#include <windows.h>
#include <iostream>
#include <malloc.h>

using namespace std;

Singleton* Singleton::single = NULL;

Singleton* Singleton::getInstance()
{
    if(single == NULL)
        single = new Singleton();
	return single;
}

Singleton::Singleton()
{
	simon = new CTexture("Resources/simon.png", 8, 3, 24);
	
	vampireBat = new CTexture("Resources/enemy/0.png", 4, 1, 4);
	zombie = new CTexture("Resources/enemy/1.png", 2, 1, 2);
	blackLeopard = new CTexture("Resources/enemy/2.png", 4, 1, 4);
	fishMan = new CTexture("Resources/enemy/3.png", 3, 1, 3);
	axeMan = new CTexture("Resources/ground/4.png", 2, 1, 2);
	blackKnight = new CTexture("Resources/enemy/5.png", 4, 1, 4);
	medusa = new CTexture("Resources/enemy/6.png", 2, 1, 2);
	whiteSkeleton = new CTexture("Resources/enemy/7.png", 4, 1, 4);
	dragonSkullCannon = new CTexture("Resources/enemy/8.png", 1, 1, 1);
	ghost = new CTexture("Resources/enemy/9.png", 2, 1, 2);
	
	candle = new CTexture("Resources/ground/1.png", 2, 1, 2);
	largeCandle = new CTexture("Resources/ground/0.png", 2, 1, 2);

}

CTexture* Singleton::getTexture(EnumID id)
{
	switch(id)
	{
	case EnumID::Simon_ID:
		return simon;

	case EnumID::VampireBat_ID:
		return vampireBat;
	case EnumID::Zombie_ID:
		return zombie;
	case EnumID::AxeMan_ID:
		return axeMan;
	case EnumID::FishMan_ID:
		return fishMan;
	case EnumID::BlackLeopard_ID:
		return blackLeopard;
	case EnumID::BlackKnight_ID:
		return blackKnight;
	case EnumID::Medusa_ID:
		return medusa;
	case EnumID::WhiteSkeleton_ID:
		return whiteSkeleton;
	case EnumID::DragonSkullCannon_ID:
		return dragonSkullCannon;
	case EnumID::Ghost_ID:
		return ghost;
		
	case EnumID::Candle_ID:
		return candle;
	case EnumID::LargeCandle_ID:
		return largeCandle;
	}
}